//
//  UIScrollView+Refresh.m
//  PU
//
//  Created by 王右 on 2017/12/22.
//  Copyright © 2017年 tiangongwang. All rights reserved.
//

#import "UIScrollView+Refresh.h"
#import "MJRefresh.h"

@implementation UIScrollView (Refresh)

//下来加载开始结束
- (void)headerRefreshBegin{
    [self.mj_header beginRefreshing];
}
- (void)headerRefreshEnd{
    [self.mj_header endRefreshing];
}


//上拉加载开始结束
- (void)footerRefreshBegin{
    [self.mj_footer beginRefreshing];
}

- (void)footerRefreshEnd{
    [self.mj_footer endRefreshing];
}

//刷新无数据
- (void)endRefreshingWithNoMoreData{
    [self.mj_footer endRefreshingWithNoMoreData];
}

//设置刷新
- (void)headerRefreshWithCompletion:(void (^)(void))headerCompletion
        footerRefreshWithCompletion:(void (^)(void))footerCompletion
{
    if (headerCompletion) {
        self.mj_header = [MJRefreshStateHeader headerWithRefreshingBlock:headerCompletion];
    }
    if (footerCompletion) {
        self.mj_footer = [MJRefreshAutoStateFooter footerWithRefreshingBlock:footerCompletion];
    }
}




@end
